package com.gzk.hrm.mapper;

import com.gzk.hrm.domain.CourseType;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 课程目录 Mapper 接口
 * </p>
 *
 * @author jake.Chen
 * @since 2022-02-12
 */
public interface CourseTypeMapper extends BaseMapper<CourseType> {


    /*@Results({
            @Result(property = "id",column = "id"),
            @Result(property = "create_time",column = "create_time"),
            @Result(property = "update_time",column = "update_time"),
            @Result(property = "name",column = "name"),
            @Result(property = "pid",column = "pid"),
            @Result(property = "logo",column = "logo"),
            @Result(property = "description",column = "description"),
            @Result(property = "sort_index",column = "sortIndex"),
            @Result(property = "path",column = "path"),
            @Result(property = "total_count",column = "total_count")
        }
    )
    @Select("select * from t_course_type where pid = #{pid}")*/
    List<CourseType> selectCourseTypeTree(Long pid);

    /**
     * 根据pid查询
     * @param pid
     * @return
     */
    @Select("select * from t_course_type where pid = #{pid}")
    List<CourseType> selectByPid(Long pid);
}
